#pragma once
class Data
{
public:
	Data(int year=1, int month=1, int day=1)
	{
		_year = year;
		_month = month;
		_day = day;
	}
	void Print();
	//D1>D2
	bool operator>(Data& d);
	//D1<D2
	bool operator<=(Data& d);
	//D1==D2
	bool operator==(Data& d);
	//D+=day
	Data& operator+=(int day);
	//D+day
	Data operator +(int day);
	//D-=day
	Data& operator-=(int day);
	//D-day
	Data operator -(int day);
	//++D
	Data& operator++();
	//D++
	Data operator++(int);
	//D1-D2
	int operator-(Data d);
	int GetMonthDay(int year, int month)
	{
		int day[13] = { -1,31,28,31,30,31,30,31,31,30,31,30,31 };
		if (month == 2 && (year % 4 == 0 && year % 100 != 0 || year % 400 == 0))
		{
			return 29;
		}
		else
		{
			return day[month];
		}
	}

private:
	int _year;
	int _month;
	int _day;
};
